package cn.cs.service;

import cn.cs.mapper.CapitalPoolTypeMapper;
import cn.cs.mapper.SettlementDetailedMapper;
import cn.cs.pojo.CapitalPoolType;
import cn.cs.pojo.SettlementDetailed;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class SettlementDetailedService {

    @Resource
    private SettlementDetailedMapper settlementDetailedMapper;

    @RequestMapping(value = "/getSettlementDetailedById", method = RequestMethod.POST)
    public Map<String, String> getSettlementDetailedById(@RequestParam("id") String  id) throws Exception{
        return settlementDetailedMapper.getSettlementDetailedById(id);
    }

    @RequestMapping(value = "/getSettlementDetailedListByMap", method = RequestMethod.POST)
    public List<SettlementDetailed> getSettlementDetailedListByMap(@RequestBody Map<String, Object> param) throws Exception{
        return settlementDetailedMapper.getSettlementDetailedListByMap(param);
    }

    @RequestMapping(value = "/getSettlementDetailedCountByMap", method = RequestMethod.POST)
    public Integer getSettlementDetailedCountByMap(@RequestBody Map<String, Object> param) throws Exception{
        return settlementDetailedMapper.getSettlementDetailedCountByMap(param);
    }

    @RequestMapping(value = "/addSettlementDetailed", method = RequestMethod.POST)
    public Integer addSettlementDetailed(@RequestBody SettlementDetailed settlementDetailed) throws Exception{
        return settlementDetailedMapper.insertSettlementDetailed(settlementDetailed);
    }

    @RequestMapping(value = "/modifySettlementDetailed", method = RequestMethod.POST)
    public Integer modifySettlementDetailed(@RequestBody SettlementDetailed settlementDetailed) throws Exception{
        return settlementDetailedMapper.updateSettlementDetailed(settlementDetailed);
    }

    @RequestMapping(value = "/deleteSettlementDetailedById", method = RequestMethod.POST)
    public Integer deleteSettlementDetailedById(@RequestParam("id") String  id) throws Exception{
        return settlementDetailedMapper.deleteSettlementDetailedById(id);
    }

    @RequestMapping(value = "/updateSettlementDetailedState", method = RequestMethod.POST)
    public Integer updateSettlementDetailedState(@Param("id")String id, @Param("personId")String personId)throws Exception{
        return settlementDetailedMapper.updateSettlementDetailedState(id, personId);
    }

    @RequestMapping(value = "/insertRepairOrderList", method = RequestMethod.POST)
    public Integer insertRepairOrderList(List<Map<String, String>> list)throws Exception{
        return settlementDetailedMapper.insertRepairOrderList(list);
    }

    @RequestMapping(value = "/getSetHisList", method = RequestMethod.POST)
    List<Map<String,Object>> getSetHisList(@RequestParam("id")String id){
        return settlementDetailedMapper.getSetHisList(id);
    }

    @RequestMapping(value = "/getSetInfoById", method = RequestMethod.POST)
    Map<String,Object> getSetInfoById(@RequestParam("id") String id){
        return settlementDetailedMapper.getSetInfoById(id);
    }

    @RequestMapping(value = "/capitalInfoList", method = RequestMethod.POST)
    List<Map<String,Object>> capitalInfoList(){
        return settlementDetailedMapper.capitalInfoList();
    }

}
